package com.neutech.neusys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.neutech.neusys.service.SysService;
import com.neutech.po.NeuSys;



@Controller
@RequestMapping(value = "/his")
public class SysController {
	@Autowired
	private SysService sysservice;
	@RequestMapping("/getNeuSysById")
	public @ResponseBody NeuSys getNeuSys(Integer id) {
		NeuSys neuSys = sysservice.getNeuSys(id);
		return neuSys;
	}
 
	@RequestMapping(value = "/update", method = RequestMethod.GET)
	public  @ResponseBody String update(NeuSys neuSys) {
		int result = sysservice.getUpdate(neuSys);
		if (result >= 1) {
			return "修改成功";
		} else { 
			return "修改失败";
		}
	}
	  
	@RequestMapping(value = "/insert", method = RequestMethod.GET)
	public  @ResponseBody NeuSys insert(NeuSys neuSys) {
		return sysservice.insertNeuSys(neuSys);
	}
	
	@RequestMapping(value = "/delete", method = RequestMethod.GET)
	public @ResponseBody String delete(int id) {
		int result = sysservice.delete(id);
		if (result >= 1) {
			return "删除成功";
		} else {
			return "删除失败";
		}
	}
}
